home *** CD-ROM | disk | FTP | other *** search
- on exitFrame
- go(the frame)
- end
-
- on enterFrame
- set the constraint of sprite 4 to 3
- set dy to float(the locV of sprite 2 - the locV of sprite 4)
- set dy to -dy
- set dx to float(the locH of sprite 2 - the locH of sprite 4)
- if dx = 0 then
- if dy < 0 then
- set theta1 to float(1.5 * PI)
- else
- set theta1 to float(PI / 2.0)
- end if
- else
- if dx > 0 then
- set theta1 to float(atan(float(dy / dx)))
- if theta1 < 0 then
- set theta1 to float(theta1) + (2.0 * PI)
- end if
- else
- set theta1 to float(atan(float(dy / dx))) + PI
- end if
- end if
- set RR to float(sqrt((dx * dx) + (dy * dy)) / 15.0)
- if RR > 3 then
- set RR to RR * 0.85999999999999999
- else
- if RR > 2 then
- set RR to RR * 0.94999999999999996
- end if
- end if
- set the floatPrecision to 1
- put RR into field "R1"
- if theta1 > PI then
- set theta1 to theta1 - PI
- else
- set theta1 to theta1 + PI
- end if
- set theta2 to theta1 * 180.0 / PI
- if theta2 = 360 then
- put "0.0" into field "theta"
- else
- put theta2 into field "theta"
- end if
- updateStage()
- end
-